%h3
  需求
  %span(style="font-size:12px;float:right;")
    - if action_name=='uncompleted'
      = link_to '(全部)', project_requirements_path(@project), remote_options
    - else
      = link_to '(未完成)', uncompleted_project_requirements_path(@project), remote_options

#filterDiv
  = remote_filter_form_tag do |f|
    模块
    = select_tag 'modu_id', options_from_collection_for_select(@project.modus,'id','name',@filter['modu_id']),:include_blank => true
    重要性
    = select_tag 'importance', options_for_select(Requirement::IMPORTANCE,@filter['importance']), :include_blank => true
    - unless action_name=='uncompleted'
      状态
      = select_tag 'status',  options_for_select(Requirement::STATUS,@filter['status']), :include_blank => true
    概要
    = text_field_tag 'abstract', @filter['abstract'], :style=>'width:80px;'
    标签
    = text_field_tag 'tag', @filter['tag'], :style=>'width:60px;'
    .actions
      = submit_tag '筛选'

%table.list-table
  %tr
    %th 提出人
    %th 提出日期
    %th 重要性
    %th 概要
    %th 模块
    %th 附件
    %th 评论
    %th 记录人
    %th 记录日期
    %th 状态
    %th

  - dl=7.days.ago
  - @requirements.each do |m|
    %tr{:id => "r_#{m.id}"}
      %td= m.raised_by.name
      %td= m.raised_on
      %td{:class => css_class_by_importance(m.importance)}= m.importance_name
      %td{:title=>m.content}= m.abstract
      %td= m.modu.name if m.modu
      %td= non_zero(m.attachments_count)
      %td= non_zero(m.comments_count)
      %td= m.registrar.name
      %td= m.created_at.strftime('%Y-%m-%d')
      %td{:class => css_class_by_status(m.status)}= m.status_name
      %td
        = link_to '详细', resource_path(m), remote_options
        - if m.created_at > dl and (not m.confirmed or @cu.pm?(@project))
          = link_to '修改', edit_resource_path(m), remote_options
          = link_to '删除', resource_path(m), :confirm => "确定要删除吗? 如果有附件同时也会被删除！", :method => :delete, :remote => true
= will_paginate @requirements
%br

= link_to '增加', new_resource_path, remote_options

